<template>
  <section>
    <div class="custorm--modelbox marketspike-edit">
      <div class="renohome-right-nav flex-row flex-justify-c flex-align-c">
        <renohome-right-nav
          :custormItemData="custormItemData"
          @rightNavChange="rightNavChange"
          :showChange="'1'"
        ></renohome-right-nav>
      </div>
      <section v-if="nrActive">

        <!-- 选择秒杀活动 -->
        <div class="edit-form-item marginbtn">
          <div class="form-label">选择秒杀方式</div>
          <el-radio-group
            v-model="custormItemData.params.activitytype"
            @change="activitytypebtn"
          >
            <el-radio label="1">普通模式</el-radio>
            <!-- <el-radio label="2">整点秒杀</el-radio> -->
          </el-radio-group>
        </div>
         <div class="edit-form-item marginbtn" v-if="custormItemData.params.activitytype==1">
          <div class="form-label">选择秒杀活动</div>
          <el-radio-group v-model="custormItemData.params.choostype" @change="clearChooseRadio">
            <el-radio label="1">按活动选择</el-radio>
            <el-radio label="2">按商品选择</el-radio>
          </el-radio-group>
         </div>
        <!-- 主标题 -->
        <div class="edit-form-item" >
          <div class="form-label">主标题</div>
          <el-form
            label-width="50px"
            size="mini"
            class="goodsset"
            label-position="right"
            style="margin-top:20px;"
          >
            <el-form-item label="标题">
              <el-input
                v-model="custormItemData.style.text"
                size="small"
                :maxlength="5"
                show-word-limit
              >
              </el-input>
            </el-form-item>
          </el-form>
        </div>
         <!-- 普通模式活动链接 -->
        <div
          class="edit-form-item"
          v-if="custormItemData.params.activitytype==1"
        >
         <div class="form-label mb-20">活动链接</div>
          <el-form
              label-width="50px"
              size="mini"
              class="goodsset"
              label-position="right"
              style="margin-top:20px;"
            >
              <el-form-item label="链接">
                <div class="item-inner flex-row">
                <div class="readonly-div" @click="uploadtoggle('link')">
                  <div class="readonly ivu-input-wrapper ivu-input-wrapper-default ivu-input-type">
                    <input autocomplete="off" spellcheck="false" type="text" placeholder="请选择链接" readonly="readonly" class="ivu-input ivu-input-default" :value="custormItemData.style.title">
                  </div> <i class="icon icon-fujian readonly-icon" style="left: 12px;margin-top:-3px;"></i>
                </div>
              </div>
              </el-form-item>
              <el-form-item label="" v-if="custormItemData.params.choostype==2">
              <div class="flex-row choose-item-lits">
                <div
                  v-for="(item, index) in custormItemData.data"
                  :key="index"
                  class="choose-item-child"
                >
                  <img
                    :src="item.image && item.image[0] ? item.image[0].file_path : ''"
                    alt=""
                    class="small"
                  >
                  <i
                    class="delete el-icon-close"
                    @click="delItemList({data:custormItemData.data,index})"
                    style="font-size: 16px;"
                  ></i>
                </div>
              </div>
            </el-form-item>
            </el-form>
        </div>
        <!-- 状态/抢购按钮/标题背景 -->
        <div class="edit-form-item">
          <div class="form-label">状态/抢购按钮/标题背景</div>
          <el-form
            label-width="50px"
            size="mini"
            class="goodsset"
            label-position="right"
            style="margin-top:20px;"
          >
            <div
              class="flex-row flex-align-c ivu-color-picker"
              style="margin-left:20px;"
            >
              <span style="margin-right:13px;">背景颜色</span>
              <el-color-picker
                v-model="custormItemData.style.maincolor"
                size="mini"
              ></el-color-picker>
              <span style="width:70px;background:#fff;padding: 5px;margin-left: 8px;">{{custormItemData.style.maincolor}}</span>
            </div>
            <div
              class="flex-row flex-align-c ivu-color-picker"
              style="margin-left:20px;margin-top:5px;"
            >
              <span style="margin-right:13px;">字体颜色</span>
              <el-color-picker
                v-model="custormItemData.style.sizecolor"
                size="mini"
              ></el-color-picker>
              <span style="width:70px;background:#fff;padding: 5px;margin-left: 8px;">{{custormItemData.style.sizecolor}}</span>
            </div>
          </el-form>
        </div>
        <!-- 秒杀会员价 -->
        <!-- <div class="edit-form-item">
          <div class="form-label">秒杀会员价</div>
          <el-radio-group v-model="custormItemData.params.memberprice">
            <el-radio label="1">开启</el-radio>
            <el-radio label="2">隐藏</el-radio>
          </el-radio-group>
        </div> -->
        <!-- 秒杀分销佣金 -->
        <!-- <div class="edit-form-item">
          <div class="form-label">秒杀分销佣金</div>
          <el-radio-group v-model="custormItemData.params.seckillcomm">
            <el-radio label="1">开启</el-radio>
            <el-radio label="2">隐藏</el-radio>
          </el-radio-group>
        </div> -->
        <!-- 商品展示数量 -->
        <!-- <div class="edit-form-item" v-if="custormItemData.params.activitytype==2">
          <div class="form-label">商品展示数量</div>
          <el-radio-group v-model="custormItemData.params.commoditynum">
            <el-radio label="1">全部</el-radio>
            <el-radio label="2">部分</el-radio>
          </el-radio-group>
          <div
            v-if="custormItemData.params.commoditynum==2"
            class="inner"
          >
            <div
              class="form-label"
              style="margin-top: 20px;"
            >显示条数</div>
            <div class="flex-row flex-align-c">
              <el-slider
                :show-tooltip="false"
                style="width: 70%;margin-left:10px;"
                v-model="listitem"
                input-size="mini"
                :max="20"
                :min="1"
              >
              </el-slider>
              <div class="coupon-showslider">{{custormItemData.params.listitem}}个</div>
            </div>
          </div>
        </div> -->
         <div class="edit-form-item" >
            <div class="form-label" style="margin-top:20px;" >是否显示分销商佣金</div>
                <!-- charges -->
                <el-radio-group v-model="custormItemData.style.charges" >
                    <el-radio label="1">是</el-radio>
                    <el-radio label="2">否</el-radio>
                </el-radio-group>
                 <div v-if="custormItemData.style.charges==1" class="stylebox flex-row flex-align-c">
                    <span style="margin-right:13px;">文字</span>
                    <el-input v-model="custormItemData.style.commission" :maxlength="1" size="mini">
                    </el-input>
                </div>
         </div>
       
        <!-- 整点秒杀活动链接 -->
        <div
          class="edit-form-item"
          v-if="custormItemData.params.activitytype==2"
        >
          <div class="form-label mb-20">活动链接</div>
          <el-form
            label-width="50px"
            size="mini"
            class="goodsset"
            label-position="right"
            style="margin-top:20px;"
          >
            <div
              v-for="(item,index) in custormItemData.params.lianData"
              :key="index"
            >
              <el-form-item label="链接">
                <div
                  class="readonly-div"
                  @click="uploadtoggle('link',index)"
                >
                  <div class="readonly ivu-input-wrapper ivu-input-wrapper-default ivu-input-type">
                    <input
                      autocomplete="off"
                      spellcheck="false"
                      type="text"
                      placeholder="请选择链接"
                      readonly="readonly"
                      class="ivu-input ivu-input-default"
                      :value=" item.texttitle"
                    >
                  </div>
                </div>
              </el-form-item>
            </div>
            <div
              class="goodscol-add"
              @click="addItemList"
            ><i class="el-icon-plus"></i> 添加</div>
          </el-form>
        </div>
        <div
          class="edit-form-item"
          v-if="custormItemData.style.display==2"
        >
          <div class="form-label">显示内容</div>
          <!-- <el-checkbox true-label="1" false-label="2" v-model="custormItemData.style.name">商品名称</el-checkbox> -->
          <!-- <el-checkbox true-label="1" false-label="2" v-model="custormItemData.style.price">秒杀价</el-checkbox> -->
          <el-checkbox
            true-label="1"
            false-label="2"
            v-model="custormItemData.style.oldprice"
          >原价</el-checkbox>
          <el-checkbox
            v-if="custormItemData.style.display==2"
            true-label="1"
            false-label="2"
            v-model="custormItemData.style.progress"
          >秒杀进度表</el-checkbox>
          <!-- <el-checkbox true-label="1" false-label="2" v-model="custormItemData.style.progress" style="margin-left:0;margin-top:10px;">秒杀进度表</el-checkbox> -->
          <!-- <el-checkbox true-label="1" false-label="2" v-model="custormItemData.style.countdown">抢购倒计时</el-checkbox> -->
        </div>
      </section>

      <section v-if="fgActive">
        <div
          class="es-form-item goods"
          style="border-bottom: 0px;"
        >
        <!-- 两列正方形风格 -->
          <div
            class="item-inner block"
            style="transform: scale(0.8) translate(-50px, -20px); width: 375px;"
          ><label
              class="button-img block"
              @click="changePattern(1)"
              v-bind:class="{active:custormItemData.style.display==1}"
              style="border-color: rgb(237, 237, 237);"
            ><input
                type="radio"
                value="style1"
                class="opacity-0"
              >

              <div class="es-seckill-group style-row" style="overflow:hidden;">
                <div class="flex es-seckill-title" v-if="custormItemData.params.activitytype=='1'">
                  <p class="title">限时秒杀</p>
                  <p>距离本场结束<span style="background">2天</span><span>19</span> 时 <span> 19 </span> 分 <span> 19 </span> 秒</p>
                </div>
               <div v-if="custormItemData.params.activitytype=='2'">
                  <div style="display:flex;justify-content:space-between;" v-if="custormItemData.params.activitytype=='2'">
                  <div style="font-size:16px;font-weight:bold;padding:10px 10px 10px 25px;">整点秒杀</div>
                  <div style="font-size:14px;color:#999999;padding:10px 10px 10px 15px;">邀请好友一起抢</div>
                </div>
               <div style="width:400px;display:flex;">
                  <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>16:40</div>
                    <div>8月6号</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>16:40</div>
                    <div>抢购中</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>明日16:40</div>
                    <div>未开始</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>明日16:40</div>
                    <div>未开始</div>
                </div>
               </div>
               </div>
                <div class="group" style="display:flex;justify-content:space-around;">
                    <div>
                      <div
                        v-for="(item, index) in custormItemData.params.defaultData"
                        :key="index"
                        class="es-seckill-col"
                      >
                        <div class="image"><span v-bind:style="{background:custormItemData.style.iconcolor}">{{custormItemData.style.text}}</span>
                          <img
                            :src="getPath('default_picture.png')"
                            alt=""
                            draggable="false"
                          ></div>
                        <div class="detail">
                          <p class="title  two-line-hide">这里是商品标题</p>
                            <div style="display:flex;justify-content:space-between;" >
                              <el-progress :percentage="40" color="#FFD940" :show-text=false style="width:50%;margin-top:5px;"></el-progress>
                              <div style="font-size:5px;color:#999999;">
                                  剩余999份
                              </div>
                            </div>
                        <div style="display:flex;justify-content:space-between;align-items:center;">
                          <div style="">
                            <div style="color:#ff4444;font-size:20px;">￥55.02</div>
                            <div style="color:#999999;font-size:10px;text-decoration:line-through;">￥55.02</div>
                          </div>

                        </div>
                        </div>
                      </div>
                    </div>

                    <div>
                      <div
                        v-for="(item, index) in custormItemData.params.defaultData"
                        :key="index"
                        class="es-seckill-col"
                      >
                        <div class="image"><span v-bind:style="{background:custormItemData.style.iconcolor}">{{custormItemData.style.text}}</span>
                          <img
                            :src="getPath('default_picture.png')"
                            alt=""
                            draggable="false"
                          ></div>
                        <div class="detail">
                          <p class="title  two-line-hide">这里是商品标题</p>
                            <div style="display:flex;justify-content:space-between;" >
                              <el-progress :percentage="40" color="#FFD940" :show-text=false style="width:50%;margin-top:5px;"></el-progress>
                              <div style="font-size:5px;color:#999999;">
                                  剩余999份
                              </div>
                            </div>
                        <div style="display:flex;justify-content:space-between;align-items:center;">
                          <div style="">
                            <div style="color:#ff4444;font-size:20px;">￥55.02</div>
                            <div style="color:#999999;font-size:10px;text-decoration:line-through;">￥55.02</div>
                          </div>

                        </div>
                        </div>
                      </div>
                    </div>

                </div>
          </div>
            </label>
            </div>
            <!-- 两列长方形样式 -->
            <div
            class="item-inner block"
            style="transform: scale(0.8) translate(-50px, -80px); width: 375px;"
          ><label
              class="button-img block"
              @click="changePattern(2)"
              v-bind:class="{active:custormItemData.style.display==2}"
              style="border-color: rgb(237, 237, 237);"
            ><input
                type="radio"
                value="style1"
                class="opacity-0"
              >

              <div class="es-seckill-group style-row" style="overflow:hidden;">
                <div class="flex es-seckill-title" v-if="custormItemData.params.activitytype=='1'">
                  <p class="title">限时秒杀</p>
                  <p>距离本场结束<span style="background">2天</span><span>19</span> 时 <span> 19 </span> 分 <span> 19 </span> 秒</p>
                </div>
                <div v-if="custormItemData.params.activitytype=='2'">
                  <div style="display:flex;justify-content:space-between;" v-if="custormItemData.params.activitytype=='2'">
                  <div style="font-size:16px;font-weight:bold;padding:10px 10px 10px 25px;">整点秒杀</div>
                  <div style="font-size:14px;color:#999999;padding:10px 10px 10px 15px;">邀请好友一起抢</div>
                </div>
               <div style="width:400px;display:flex;">
                  <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>16:40</div>
                    <div>8月6号</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>16:40</div>
                    <div>抢购中</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>明日16:40</div>
                    <div>未开始</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>明日16:40</div>
                    <div>未开始</div>
                </div>
               </div>
               </div>
                <div class="group" style="display:flex;justify-content:space-around;">
                    <div>
                      <div
                        v-for="(item, index) in custormItemData.params.defaultData"
                        :key="index"
                        class="es-seckill-col"
                      >
                        <div class="image2"><span v-bind:style="{background:custormItemData.style.iconcolor}">{{custormItemData.style.text}}</span>
                          <img
                            :src="getPath('default_picture.png')"
                            alt=""
                            style="width:140px;height:100px;"
                          ></div>
                        <div class="detail">
                          <p class="title  two-line-hide">这里是商品标题</p>
                            <div style="display:flex;justify-content:space-between;" >
                              <el-progress :percentage="40" color="#FFD940" :show-text=false style="width:50%;margin-top:5px;"></el-progress>
                              <div style="font-size:5px;color:#999999;">
                                  剩余999份
                              </div>
                            </div>
                        <div style="display:flex;justify-content:space-between;align-items:center;">
                          <div style="">
                            <div style="color:#ff4444;font-size:20px;">￥55.02</div>
                            <div style="color:#999999;font-size:10px;text-decoration:line-through;">￥55.02</div>
                          </div>

                        </div>
                        </div>
                      </div>
                    </div>

                    <div>
                      <div
                        v-for="(item, index) in custormItemData.params.defaultData"
                        :key="index"
                        class="es-seckill-col"
                      >
                        <div class="image2"><span v-bind:style="{background:custormItemData.style.iconcolor}">{{custormItemData.style.text}}</span>
                          <img
                            :src="getPath('default_picture.png')"
                            alt=""
                            style="width:140px;height:100px;"
                          ></div>
                        <div class="detail">
                          <p class="title  two-line-hide">这里是商品标题</p>
                            <div style="display:flex;justify-content:space-between;" >
                              <el-progress :percentage="40" color="#FFD940" :show-text=false style="width:50%;margin-top:5px;"></el-progress>
                              <div style="font-size:5px;color:#999999;">
                                  剩余999份
                              </div>
                            </div>
                        <div style="display:flex;justify-content:space-between;align-items:center;">
                          <div style="">
                            <div style="color:#ff4444;font-size:20px;">￥55.02</div>
                            <div style="color:#999999;font-size:10px;text-decoration:line-through;">￥55.02</div>
                          </div>

                        </div>
                        </div>
                      </div>
                    </div>

                </div>
          </div>
            </label>
            </div>
          <!-- 三列正方形样式 -->
           <div
            class="item-inner block"
            style="transform: scale(0.8) translate(-50px, -140px); width: 375px;"
          ><label
              class="button-img block"
              @click="changePattern(3)"
              v-bind:class="{active:custormItemData.style.display==3}"
              style="border-color: rgb(237, 237, 237);"
            ><input
                type="radio"
                value="style1"
                class="opacity-0"
              >

              <div class="es-seckill-group style-row" style="overflow:hidden;">
                <div class="flex es-seckill-title" v-if="custormItemData.params.activitytype=='1'">
                  <p class="title">限时秒杀</p>
                  <p>距离本场结束<span style="background">2天</span><span>19</span> 时 <span> 19 </span> 分 <span> 19 </span> 秒</p>
                </div>
                 <div v-if="custormItemData.params.activitytype=='2'">
                  <div style="display:flex;justify-content:space-between;" v-if="custormItemData.params.activitytype=='2'">
                  <div style="font-size:16px;font-weight:bold;padding:10px 10px 10px 25px;">整点秒杀</div>
                  <div style="font-size:14px;color:#999999;padding:10px 10px 10px 15px;">邀请好友一起抢</div>
                </div>
               <div style="width:400px;display:flex;">
                  <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>16:40</div>
                    <div>8月6号</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>16:40</div>
                    <div>抢购中</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>明日16:40</div>
                    <div>未开始</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>明日16:40</div>
                    <div>未开始</div>
                </div>
               </div>
               </div>
                <div class="group" style="display:flex;">
                    <div>
                      <div
                        v-for="(item, index) in custormItemData.params.defaultData"
                        :key="index"
                        class="es-seckill-col"
                      >
                        <div class="image4"><span v-bind:style="{background:custormItemData.style.iconcolor}">{{custormItemData.style.text}}</span>
                          <img
                            :src="getPath('default_picture.png')"
                            alt=""
                            style="width:110px;height:100px"
                          ></div>
                        <div class="detail">
                          <p class="title  two-line-hide">这里是商品标题</p>
                            <div style="display:flex;justify-content:space-between;" >
                              <el-progress :percentage="40" color="#FFD940" :show-text=false style="width:50%;margin-top:5px;"></el-progress>
                              <div style="font-size:5px;color:#999999;">
                                  剩余999份
                              </div>
                            </div>
                        <div style="display:flex;justify-content:space-between;align-items:center;">
                          <div style="">
                            <div style="color:#ff4444;font-size:20px;">￥55.02</div>
                            <div style="color:#999999;font-size:10px;text-decoration:line-through;">￥55.02</div>
                          </div>

                        </div>
                        </div>
                      </div>
                    </div>

                     <div>
                      <div
                        v-for="(item, index) in custormItemData.params.defaultData"
                        :key="index"
                        class="es-seckill-col"
                      >
                        <div class="image4"><span v-bind:style="{background:custormItemData.style.iconcolor}">{{custormItemData.style.text}}</span>
                          <img
                            :src="getPath('default_picture.png')"
                            alt=""
                            style="width:110px;height:100px"
                          ></div>
                        <div class="detail">
                          <p class="title  two-line-hide">这里是商品标题</p>
                            <div style="display:flex;justify-content:space-between;" >
                              <el-progress :percentage="40" color="#FFD940" :show-text=false style="width:50%;margin-top:5px;"></el-progress>
                              <div style="font-size:5px;color:#999999;">
                                  剩余999份
                              </div>
                            </div>
                        <div style="display:flex;justify-content:space-between;align-items:center;">
                          <div style="">
                            <div style="color:#ff4444;font-size:20px;">￥55.02</div>
                            <div style="color:#999999;font-size:10px;text-decoration:line-through;">￥55.02</div>
                          </div>

                        </div>
                        </div>
                      </div>
                    </div>
                     <div>
                      <div
                        v-for="(item, index) in custormItemData.params.defaultData"
                        :key="index"
                        class="es-seckill-col"
                      >
                        <div class="image4"><span v-bind:style="{background:custormItemData.style.iconcolor}">{{custormItemData.style.text}}</span>
                          <img
                            :src="getPath('default_picture.png')"
                            alt=""
                            style="width:110px;height:100px"
                          ></div>
                        <div class="detail">
                          <p class="title  two-line-hide">这里是商品标题</p>
                            <div style="display:flex;justify-content:space-between;" >
                              <el-progress :percentage="40" color="#FFD940" :show-text=false style="width:50%;margin-top:5px;"></el-progress>
                              <div style="font-size:5px;color:#999999;">
                                  剩余999份
                              </div>
                            </div>
                        <div style="display:flex;justify-content:space-between;align-items:center;">
                          <div style="">
                            <div style="color:#ff4444;font-size:20px;">￥55.02</div>
                            <div style="color:#999999;font-size:10px;text-decoration:line-through;">￥55.02</div>
                          </div>

                        </div>
                        </div>
                      </div>
                    </div>
                </div>
          </div>
            </label>
            </div>
      <!-- 单列 -->
          <div
            class="item-inner block"
            style="transform: scale(0.8) translate(-50px, -185px); width: 375px;"
          ><label
              class="button-img block"
              @click="changePattern(4)"
              v-bind:class="{active:custormItemData.style.display==4}"
              style="border-color: rgb(237, 237, 237);padding:0;"
            ><input
                type="radio"
                value="style2"
                class="opacity-0"
              >

              <div class="es-seckill-group style-col" style="overflow:hidden;">
                <!-- <div class="flex es-seckill-title">
                  <p class="title">限时秒杀</p>
                  <p><span>距离结束</span><span>19</span> : <span>19</span> : <span>19</span></p>
                </div> -->
                <div v-if="custormItemData.params.activitytype=='2'">
                  <div style="display:flex;justify-content:space-between;" v-if="custormItemData.params.activitytype=='2'">
                  <div style="font-size:16px;font-weight:bold;padding:10px 10px 10px 25px;">整点秒杀</div>
                  <div style="font-size:14px;color:#999999;padding:10px 10px 10px 15px;">邀请好友一起抢</div>
                </div>
               <div style="width:400px;display:flex;">
                  <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>16:40</div>
                    <div>8月6号</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>16:40</div>
                    <div>抢购中</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>明日16:40</div>
                    <div>未开始</div>
                </div>
                 <div style=" background:#fff;border-radius:6px;line-height:20px;color:#999999;font-size:14px;padding:10px 10px 10px 10px;display: inline-block;margin-left:24px;">
                    <div>明日16:40</div>
                    <div>未开始</div>
                </div>
               </div>
               </div>
                    <div style="margin: 20px 20px 6px;height: 22px;font-size: 11px;display: flex;justify-content: space-between;" v-if="custormItemData.params.activitytype=='1'">
                      <div class="title">限时秒杀</div>
                      <div>距离本场结束<span style="background">2天</span><span>19</span> 时 <span> 19 </span> 分 <span> 19 </span> 秒</div>
                    </div>
                <div class="group">
                  <div>
                    <!-- ---- -->
                    <div
                      v-for="(item, index) in custormItemData.params.defaultData"
                      :key="index"
                      class="es-seckill-col flex-row flex-align-c"
                    >
                      <div class="image"><span v-bind:style="{background:custormItemData.style.iconcolor}">{{custormItemData.style.text}}</span>
                        <img
                          :src="getPath('default_picture.png')"
                          alt=""
                          draggable="false"
                        ></div>
                      <div class="detail">
                        <p class="title  line-hide">这里是商品标题</p>
                        <div class="flex-col progress-box">
                       <el-progress :percentage="40" color="#FFD940" :show-text=false style="width:50%;margin-top:5px;"></el-progress>
                  </div>
                        <div class="sales-num">
                          <div class="flex-row flex-justify-b flex-align-c">
                            <div class="subtitle line-hide">
                              <p>
                                <span class="sub-price"><span class="icon">￥</span>29.00</span>
                                <span class="sub-price line-through"><span class="icon">￥</span>129.00</span>
                              </p>
                            </div>
                            <div class="flex-row flex-align-c">

                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>

                </div>
              </div>
            </label></div>
        </div>
      </section>
    </div>
  </section>
</template>

<script>
import defaultConfig from './utils/editConfig'
import activeChoose from './utils/activeChoose'
export default {
  mixins: [defaultConfig.mixins],
  props: {
    defaultConfig: {
      type: Object,
      default: function() {
        return defaultConfig
      }
    }
  },
  data() {
    return {
      index: 0
    }
  },
  computed: {
    listitem: {
      set(value) {
        this.custormItemData.params.listitem = value
      },
      get() {
        return this.conversionType('number', this.custormItemData.params.listitem)
      }
    }
  },
  mounted() { },
  methods: {
    ...activeChoose,
    uploadFileCallBack(files) {
      console.log('files++++++++++++++', files)
      const { key } = files
      if (key === 'ChooseLink') {
        // const { displayData = [], listData = [], currentRow: [file_path] } = files
        const { displayData = [], listData = [] } = files
        const reslut = []
        if (!listData.length) {
          const [{ title = '', id }] = displayData
          this.custormItemData.params.link = id
          this.custormItemData.style.title = title
          this.custormItemData.params.lianData.map((item, index) => {
            console.log('++++++++++++++++', item)
            if (index == this.index) {
              item.texttitle = title
              item.link = id
            }
          })
          // this.custormItemData.lianData[this.imgCurrent]['texttitle'] = file_path
          this.$forceUpdate()
        } else {
          console.log(this.custormItemData.params.link, 'this.custormItemData.params.link')
          listData.map((listItem) => {
            const newIndex = this.custormItemData.data.findIndex((displayItem) => {
              return `${displayItem.goods_id}` === `${listItem.goods_id}`
            })
            if (newIndex === -1) {
              reslut.push(listItem)
            }
          })
        }
        this.$set(this.custormItemData, 'data', [...this.custormItemData.data, ...reslut])
        console.log(this.custormItemData.data, 'this.custormItemData')
      }
    },
    uploadtoggle(type, index) {
      this.index = index
      this.output({ type, params: { editKey: this.custormItemData.key, link_type: 'spike', choose_type: this.custormItemData.params.choostype == 2 ? this.custormItemData.params.choostype == 1 ? this.custormItemData.params.choostype : 2 : 1 } })
    },
    addItemList() {
      this.custormItemData.params.lianData.push({
        texttitle: ''
      })
    },
    activitytypebtn() {
      if (this.custormItemData.params.activitytype == '2') {
        this.custormItemData.style.title = ''
        this.custormItemData.params.choostype = '1'
      }
      if (this.custormItemData.params.activitytype == '1') {
        this.custormItemData.params.lianData = []
      }
    }
  }
}

</script>

<style lang="scss" scoped>
.custorm--modelbox.marketspike-edit {
  .es-form-item {
    border-bottom: 5px solid #f6f7f9;
    padding: 20px 23px;
    font-size: 12px;

    .uploadSource {
      background: #fff;
      cursor: pointer;
    }

    .uploadSource {
      width: 50px;
      height: 50px;
      line-height: 50px;
      margin-right: 0;
      border: 1px dashed #ededed;
      text-align: center;
      color: #dad9d9;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      float: left;
      position: relative;
    }
  }

  .es-form-item:last-child {
    border-bottom: 0;
  }

  .es-form-item .item-inner {
    margin-top: 8px;
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .es-form-item .item-inner:first-of-type {
    margin-top: 0;
  }

  .es-form-item .button-img {
    width: 32px;
    height: 32px;
    margin-right: 20px;
    cursor: pointer;
    border-radius: 4px;
    box-sizing: border-box;
    line-height: 36px;
    text-align: center;
    border: 1px solid transparent;
  }

  .es-form-item .button-img.block {
    width: 100%;
    position: relative;
    min-height: 32px;
    height: auto;
    padding: 10px;
    text-align: left;
  }

  .es-form-item .button-img.active {
    border-color: #fb6638 !important;
  }

  .es-form-item [type="checkbox"],
  [type="radio"] {
    box-sizing: border-box;
    padding: 0;
  }

  .es-form-item .opacity-0 {
    opacity: 0;
  }

  .es-form-item .button-img .opacity-0 {
    width: 0;
    height: 0;
    position: absolute;
  }

  .es-form-item .alignC {
    text-align: center;
  }

  .es-form-item .item {
    background: #f6f7f9;
    padding: 10px 20px 10px 10px;
    border: 1px solid #eee;
    color: #999;
    position: relative;
    margin-bottom: 20px;
  }

  .es-form-item .labeltext {
    width: 40px;
    text-align: right;
    padding-right: 8px;
    color: #666;
  }

  .readonly-div {
    position: relative;
    flex-grow: 1;
  }

  .ivu-input-wrapper {
    display: inline-block;
    width: 100%;
    position: relative;
    vertical-align: middle;
    line-height: normal;
  }

  .ivu-input {
    display: inline-block;
    width: 100%;
    height: 32px;
    line-height: 1.5;
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #ededed;
    border-radius: 4px;
    color: #333;
    background-color: #fff;
    background-image: none;
    position: relative;
    cursor: text;
    -webkit-transition: border 0.2s ease-in-out, background 0.2s ease-in-out,
      -webkit-box-shadow 0.2s ease-in-out;
    transition: border 0.2s ease-in-out, background 0.2s ease-in-out,
      box-shadow 0.2s ease-in-out;
  }

  .readonly-div .readonly input {
    background: #e8effc;
    border: 0;
    padding-left: 18px;
    cursor: pointer;
    box-sizing: border-box;
  }

  .readonly-div .readonly-icon {
    position: absolute;
    top: 5px;
    left: 12px;
  }

  .es-form-item .item .delete-child {
    position: absolute;
    right: 4px;
    top: 0;
    cursor: pointer;
    font-size: 14px;
  }

  //列表结束

  .edit-form-item {
    border-bottom: 5px solid #f6f7f9;
    padding: 20px 23px;
    font-size: 12px;
  }

  .edit-form-item:last-child {
    border-bottom: 0;
  }
  .marginbtn {
    /deep/.el-radio {
      margin-right: 0;
    }
  }
  .el-radio__label {
    font-size: 12px;
  }

  .el-checkbox__label {
    font-size: 12px;
  }

  .form-label {
    line-height: 1;
    color: #47565d;
    font-weight: bolder;
    margin-bottom: 20px !important;
  }

  .inner {
    margin-top: 12px;
    white-space: nowrap;
  }

  .goodscol-add {
    border: 1px dashed #6b7685;
    line-height: 32px;
    height: 32px;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
  }

  .stylebox {
    background: #f6f7f9;
    padding: 10px 20px;
    border: 1px solid #eee;
    color: #999;
    margin-top: 30px;
    white-space: nowrap;
  }

  .txbox {
    border-radius: 3px;
    border: 1px solid transparent;
    margin: 0 15px 0 13px;
    padding: 5px;
    cursor: pointer;
  }

  .txbox.active {
    border-color: #fb6638;
  }

  .zft {
    background: #dcdcdc;
    height: 15px;
    width: 15px;
    border-radius: 3px;
  }

  .cft {
    background: #dcdcdc;
    height: 15px;
    width: 25px;
    border-radius: 3px;
  }

  .yuan {
    background: #dcdcdc;
    height: 15px;
    width: 15px;
    border-radius: 15px;
  }

  .select-btn-box {
    background: #e8effc;
    cursor: pointer;
    border-radius: 5px;
    padding: 0 10px;
    height: 32px;
    line-height: 32px;
    width: 60%;
  }

  .select-btn-icon {
    line-height: 32px;
    float: left;
    margin-right: 5px;
  }

  .select-btn-text {
    line-height: 32px;
    display: inline-block;
    height: 32px;
    vertical-align: middle;
  }

  .el-slider__input {
    width: 105px;
  }

  .el-slider__runway.show-input {
    margin-right: 130px;
  }

  //风格
  .es-form-item .item-inner:first-of-type {
    margin-top: 0;
  }

  .es-form-item .item-inner {
    margin-top: 8px;
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .block {
    display: block !important;
  }

  .es-form-item {
    border-bottom: 5px solid #f6f7f9;
    padding: 20px 23px;
    font-size: 12px;
  }

  .es-form-item.goods .button-img {
    padding: 0;
  }

  .button-img.block {
    width: 100%;
    position: relative;
    min-height: 32px;
    height: auto;
    padding: 10px;
    text-align: left;
  }

  .button-img {
    width: 32px;
    height: 32px;
    margin-right: 20px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 36px;
    text-align: center;
    border: 1px solid transparent;
  }

  .flex,
  .flex-column {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
  }
  .es-seckill-group {
    line-height: 1;
  }
  .es-seckill-group.style-row .es-seckill-title {
    margin: 20px 20px 6px;
    height: 22px;
    font-size: 11px;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .es-seckill-group.style-row .es-seckill-title .title {
    .seckill-title {
      font-size: 18px;
      font-weight: 700;
      color: #3d404d;
      background: #fff;
    }
    font-size: 12px;
    img {
      vertical-align: middle;
      zoom: 0.5;
    }
    & + p {
      // border: 1px solid #fe504f;
      // border-radius: 3px;
      transform: scale(0.9);
      margin-right: -5px;
    }
  }

  .es-seckill-group.style-row .es-seckill-title span {
    background: #fff;
    display: inline-block;
    color: #333;
    text-align: center;
    line-height: 18px;
    width: 17px;
  }

  .es-seckill-group.style-row .es-seckill-title span:first-of-type {
    width: auto;
    // background: #fe504f;
    // color: #fff;
    font-size: 12px;
    margin-right: 8px;
    padding: 1px 3px;
  }

  .es-seckill-group.style-row .group {
    overflow: hidden;

    & > div {
      font-size: 0;
    }
  }

  .es-seckill-group.style-row .group .es-seckill-col {
    display: inline-block;
    padding: 0 0 0 5px;
    width: 126px;
    box-sizing: border-box;
    border-radius: 2px;
    &:nth-of-type(even) {
      margin-left: 10px;
    }
    .image {
      position: relative;
      height: 130px;
      margin: 4px 0 8px;
      width: 100%;
      border: 1px solid #e5e5e5;
      border-radius: 10px;
      img {
        height: 130px;
        width: 130px;
        object-fit: cover;
        border-radius: 10px;
        display: block;
      }
    }
    .image2 {
       position: relative;
        height: 100px;
        margin: 4px 0 8px;
        width: 100%;
        // border: 1px solid #e5e5e5;
        border-radius: 10px;
        img {
          height: 140px;
          width: 100px;
          object-fit: cover;
          border-radius: 10px;
          display: block;
        }
    }
    .image4{
       position: relative;
        height: 100px;
        margin: 4px 0 8px;
        width: 100%;
        // border: 1px solid #e5e5e5;
        border-radius: 10px;
        img {
          height: 100px;
          width: 90px;
          object-fit: cover;
          border-radius: 10px;
          display: block;
        }
    }
  }

  .es-seckill-group.style-row .group .es-seckill-col .image span {
    line-height: 16px;
    padding: 0 6px;
    border-radius: 0 5px 0 0;
    background: #fd463e;
    color: #fff;
    position: absolute;
    display: none;
    bottom: 0;
    left: 0;
    font-weight: 700;
    font-size: 12px;
  }

  .es-seckill-group.style-row .group .es-seckill-col .detail {
    width: 95%;
    font-size: 12px;
    padding-bottom: 20px;
    .title {
      height: 21px;
      font-size: 13px;
    }
    .subtitle {
      height: 24px;
      line-height: 1;
      .sub-price {
        font-size: 14px;
        .icon {
          font-size: 12px;
        }
        &:not(.line-through) {
          font-size: 20px;
          color: #fd463e;
          font-weight: 600;
        }
        &.line-through {
          color: #999;
          text-decoration: none;
        }
      }
    }
    .sales-num {
      .num {
        font-size: 14px;
        color: #999;
      }
      .progress {
        width: 50px;
        height: 10px;
        border-radius: 10px;
        line-height: 10px;
        background: rgb(242, 242, 242);
        .progress-num {
          display: inline-block;
          background: #fd463e;
          width: 40%;
          height: 10px;
          border-radius: 10px;
        }
      }
      // .sales-btn{
      //     border: 1px solid #fd463e;
      //     color: #fd463e;
      //     padding: 0 10px;
      //     border-radius: 30px;
      //     font-size: 14px;
      //     height: 26px;
      // }
    }
  }

  .es-seckill-group.style-row .group .es-seckill-col .detail .price .num {
    color: #999ca7;
    font-size: 9px;
    line-height: 25px;
    margin-left: 6px;
  }

  .es-seckill-group.style-row .group .es-seckill-col .detail .price .flex {
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
  }

  .es-seckill-group.style-row .group .es-seckill-col .detail .price span {
    font-size: 16px;
  }

  //   style2
  .es-seckill-group.style-col .es-seckill-title {
    background-image: url();
    background-repeat: no-repeat;
    background-size: 100% 100%;
    height: 40px;
    padding: 0 0 0 10px;
    font-size: 11px;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .es-seckill-group.style-col .es-seckill-title .title {
    font-size: 12px;
    color: #fff;
    .seckill-title {
      font-size: 18px;
      font-weight: 700;
      color: #fff;
    }
    img {
      vertical-align: middle;
      zoom: 0.5;
    }
    & + p {
      border: 1px solid #fe504f;
      border-radius: 3px;
      transform: scale(0.9);
      color: #fff;
      margin-right: -5px;
    }
  }

  .es-seckill-group.style-col .es-seckill-title span {
    background: #fff;
    display: inline-block;
    color: #333;
    text-align: center;
    line-height: 20px;
    width: 20px;
    border-radius: 3px;
  }

  .es-seckill-group.style-col .es-seckill-title span:first-of-type {
    width: auto;
    background: transparent;
    color: #fff;
    margin-right: 8px;
    padding: 1px 3px;
  }

  .es-seckill-group.style-col .group {
    overflow: hidden;

    & > div {
      white-space: nowrap;
      font-size: 0;
    }
  }

  .es-seckill-group.style-col .group .es-seckill-col {
    padding: 15px;
    box-sizing: border-box;
    border-radius: 2px;
    // border-bottom: 1px solid #999;
    padding-bottom: 12px;
    .image {
      position: relative;
      height: 97px;
      margin: 4px 0 8px;
      border: 1px solid #e5e5e5;
      border-radius: 5px;
      img {
        height: 95px;
        width: 95px;
        object-fit: cover;
        border-radius: 10px;
        display: block;
      }
    }
  }

  .es-seckill-group.style-col .group .es-seckill-col .image span {
    line-height: 16px;
    padding: 0 6px;
    border-radius: 0 5px 0 0;
    background: #fd463e;
    color: #fff;
    position: absolute;
    display: none;
    bottom: 0;
    left: 0;
    font-weight: 700;
    font-size: 12px;
  }

  .es-seckill-group.style-col .group .es-seckill-col .detail {
    width: 100%;
    font-size: 12px;
    margin-left: 15px;
    margin-right: 0;
    .title {
      font-size: 16px;
      height: 40px;
      line-height: 40px;
      overflow: hidden;
      text-overflow: ellipsis;
      width: 215px;
    }
    .subtitle {
      .sub-price {
        font-size: 14px;
        .icon {
          font-size: 12px;
        }
        &:not(.line-through) {
          font-size: 20px;
          color: #fd463e;
          font-weight: 600;
        }
        &.line-through {
          color: #999;
          text-decoration: line-through;
        }
      }
    }
    .progress-box {
      position: relative;
      height: 15px;
      margin-bottom: 15px;
      .progress {
        width: 55%;
        height: 15px;
        border-radius: 10px;
        line-height: 16px;
        text-align: center;
        background-color: #f7cfcd;
        .progress-num {
          color: #fff;
          display: inline-block;
          height: 15px;
          border-radius: 10px;
        }
      }
    }

    .sales-num {
      .sales-btn {
        border: 1px solid #fd463e;
        color: #fd463e;
        padding: 0 10px;
        border-radius: 30px;
        font-size: 14px;
        height: 26px;
      }
    }
  }

  .es-seckill-group.style-col .group .es-seckill-col .detail .price .num {
    color: #999ca7;
    font-size: 9px;
    line-height: 25px;
    margin-left: 6px;
  }

  .es-seckill-group.style-col .group .es-seckill-col .detail .price .flex {
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
  }

  .es-seckill-group.style-col .group .es-seckill-col .detail .price span {
    font-size: 16px;
  }
}
</style>
